import * as Router from "koa-router";
const route = new Router({ prefix: "/script" })
import { Restfull } from "../../config/resModel"

import {set,get ,client} from "../../redis"
import { jwtAuth } from "../../middleware/jwt"
import { dirExist } from "../../middleware/dirExist"
import { ScriptListCON } from "../../routerController/scriptList"
import { createScriptCheck } from "../../middleware/paramsCheck"
import { checkUserGameStatus } from "../../middleware/saveUserGameStatus"
route.use(jwtAuth)
//登录功能
route.get("/getList",checkUserGameStatus,ScriptListCON.getList )

//查找某一个剧本
route.get("/getScript", ScriptListCON.getScript)


//创建剧本
route.post("/addScript", createScriptCheck,dirExist,ScriptListCON.createScript)



export {
    route
}